import { FormInstance, FormItemProps } from 'ant-design-vue';
import { _IFormEl, _IExtra } from '@/src/components/common/form/interface';
import { _IColumnProps } from '@/components/common/tableEdit/interface.ts'
import { depts, isSel } from '@/common/model/base'
const formItemProps: FormItemProps & _IExtra = {
  labelWidth: '140px',
  colon: false
}

// 队伍建设的基本信息 -- 表单
export const teamFormEls: Array<_IFormEl> = [
  { label: '队伍名称', key: 'TEAM_NAME', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } 
    , componentProps: { disabled:true } 
  },
  { label: '应急部队类别', key: 'TEAM_TYPE', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps },
    componentProps: {
      options: [
        {label: '国家综合性消防救援队伍', value: '1'},
        {label: '专业应急救援队伍', value: '2'},
        {label: '社会应急力量', value: '3'},
        {label: '其他应急队伍', value: '4'},
      ],
      disabled:true
    } 
  },
  { label: '队伍隶属', key: 'TEAM_SUBJECTION', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, required: true },
    componentProps: { options: depts,disabled:true } 
  },
  { label: '队伍性质', key: 'TEAM_NATURE', col: { span: 6 }, element: 'select', 
    formItemProps: { ...formItemProps, required: true },
    componentProps: { 
      options: [
        { label: '专职救援队', value: '1'},
        { label: '公益救援队', value: '2'},
      ],disabled:true
    } 
  },
  { label: '建队时间', key: 'SETUP_TIME', col: { span: 6 }, element: 'datepicker', 
    formItemProps: { ...formItemProps, required: true } 
    , componentProps: { disabled:true } 
  },
  { label: '队伍能力类型', key: 'ABILITY_TYPE', col: { span: 6 }, element: 'select', 
    formItemProps: { ...formItemProps, required: true }, 
    componentProps: { 
      options: [
        { label: '医疗救护队', value: '1'},
        { label: '抢险救援队', value: '2'},
        { label: '搜救队伍', value: '3'},
        { label: '综合救援队', value: '4'},
      ],
      disabled:true
    } 
  },
  { label: '队伍人数', key: 'TEAM_NUM', col: { span: 6 }, element: 'number', 
    formItemProps: { ...formItemProps, } 
    , componentProps: { disabled:true } 
  },
  { label: '专职人数', key: 'FULLTIME_NUM', col: { span: 6 }, element: 'number', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '兼职人数', key: 'PARTTIME_NUM', col: { span: 6 }, element: 'number', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '地址', key: 'ADDRESS', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '经度', key: 'LONGITUDE', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '纬度', key: 'LATITUDE', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '主要负责人姓名', key: 'RESPONSIBLE_NAME', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true } 
  },
  { label: '应急联络人姓名', key: 'EMERGENCY_NAME', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true } 
  },
  { label: '应急联络电话2', key: 'EMERGENCY_TEL2', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps } , componentProps: { disabled:true } 
  },
  { label: '队长', key: 'LEADER_NAME', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps } , componentProps: { disabled:true } 
  },
  { label: '队长移动电话', key: 'LEADER_TEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '队长固定电话', key: 'LEADER_LINETEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '应急联络电话3', key: 'EMERGENCY_TEL3', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '队长移动电话', key: 'LEADER_TEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '电子邮件', key: 'RESPONSIBLE_EMAIL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '应急电子邮件', key: 'EMERGENCY_EMAIL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '应急联络电话4', key: 'EMERGENCY_TEL4', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '队长固定电话', key: 'LEADER_LINETEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '政委', key: 'POLITICAL_NAME', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps } , componentProps: { disabled:true } 
  },
  { label: '总工程师', key: 'CHIEFENGINEER_NAME', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps } , componentProps: { disabled:true } 
  },
  { label: '传真号码', key: 'FAX_NUM', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '', key: 'POLITICAL_TEL', col: { span: 6 }, element: 'text', },
  { label: '政委移动电话', key: 'POLITICAL_TEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps} , componentProps: { disabled:true } 
  },
  { label: '总工移动电话', key: 'CHIEFENGINEER_TEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '填报人', key: 'tbr', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '', key: 'empty2', col: { span: 6 }, element: 'text', },
  { label: '政委固定电话', key: 'POLITICAL_LINETEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps } , componentProps: { disabled:true } 
  },
  { label: '总工固定电话', key: 'CHIEFENGINEER_LINETEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps, } , componentProps: { disabled:true } 
  },
  { label: '填报人联系方式', key: 'CREATEUSER_TEL', col: { span: 6 }, element: 'input', 
    formItemProps: { ...formItemProps,  } , componentProps: { disabled:true } 
  },
]

// 装备列表
export const equipColsD: Array<_IColumnProps> = [
  // { title: '状态', dataIndex: 'xm', minWidth: 150, element: 'input' },
  { title: '序号', dataIndex: 'index', width: 50, align: 'center',
    customRender: ({ index }) => index += 1
  },
  { title: '装备类别', dataIndex: 'EQUIPMENT_TYPE', minWidth: 150, element: 'input' },
  { title: '装备名称', dataIndex: 'EQUIPMENT_NAME', minWidth: 150, element: 'input' },
  { title: '品牌型号', dataIndex: 'EQUIPMENT_BRAND', minWidth: 150, element: 'input' },
  { title: '数量', dataIndex: 'QUANTITY', minWidth: 150, element: 'number', align: 'center' },
  { title: '是否重要基础装备', dataIndex: 'IS_IMPORTANT_BASICS', minWidth: 150, element: 'select', align: 'center',
    componentProps: { options: isSel() },
    customRender: ({ text }) => text == 0 ? '否' : '是'
  },
  { title: '是否重要专业装备', dataIndex: 'IS_IMPORTANT_MAJOR', minWidth: 150, element: 'select', align: 'center',
    componentProps: { options: isSel() },
    customRender: ({ text }) => text == 0 ? '否' : '是'
  },
  // { title: '关键参数', dataIndex: 'KEY_PARAMETER', minWidth: 150, element: 'input' },
];

// 成员列表
export const userColsD: Array<_IColumnProps> = [
  { title: '序号', dataIndex: 'index', width: 50, align: 'center',
    customRender: ({ index }) => index += 1
  },
  { title: '姓名', dataIndex: 'USER_NAME', minWidth: 150, element: 'input', align: 'center', },
  { title: '年龄', dataIndex: 'USER_AGE', minWidth: 150, element: 'number', align: 'center', },
  { title: '性别', dataIndex: 'USER_SEX', minWidth: 150, element: 'select', align: 'center',
    componentProps: { 
      options: [{ label: '男', value: '1' }, { label: '女', value: '2'}]  
    }
  },
  { title: '联系电话', dataIndex: 'USER_TEL', minWidth: 150, element: 'number', align: 'center', },
  { title: '专/兼', dataIndex: 'PART_OR_FULL', minWidth: 150, element: 'select', align: 'center',
    componentProps: { 
      options: [{ label: '专职', value: '1' }, { label: '兼职', value: '2'}]  
    }
  },
  { title: '从业时间', dataIndex: 'WORKING_TIME', minWidth: 150, element: 'input', align: 'center',
    customRender: ({ text }) => text + '年'
  },
  { title: '骨干', dataIndex: 'BACKBONE', minWidth: 150, element: 'select', align: 'center',
    componentProps: { 
      options: isSel()  
    },
    customRender: ({ text }) => text == 'True' ? '是' : '否'
  },
  { title: '擅长专业', dataIndex: 'BE_GOOD_AT', minWidth: 150, element: 'select',
    componentProps: { 
      options: [
        { label: '医疗', value: '1' }, 
        { label: '搜救', value: '2'},
        { label: '设备维修', value: '3'},
        { label: '抢险维修', value: '4'},
        { label: '器械', value: '5'},
      ]  
    }
  },
  { title: '用工性质', dataIndex: 'USE_NATURE', minWidth: 150, element: 'select',
    componentProps: { 
      options: [{ label: '聘用', value: '1' }, { label: '编制', value: '2'}, { label: '志愿', value: '3'}]  
    }
  },
  { title: '文化程度', dataIndex: 'EDUCATIONAL_LEVEL', minWidth: 150, element: 'select',
    componentProps: { 
      options: [
        { label: '小学', value: '1' }, 
        { label: '初中', value: '2'},
        { label: '高中', value: '3'},
        { label: '大专', value: '4'},
        { label: '本科', value: '5'},
        { label: '硕士', value: '6'},
        { label: '博士', value: '7'},
      ]  
    }
  },
  { title: '技术职称', dataIndex: 'TECHNICAL_TITLE', minWidth: 150, element: 'select',
    componentProps: { 
      options: [
        { label: '初级', value: '1' }, 
        { label: '中级', value: '2'},
        { label: '高级级', value: '3'},
      ]  
    }
  },
]; 

// 救援经历 -- 表单
const jyItemProps: FormItemProps & _IExtra = {
  labelWidth: '190px',
  colon: false
}
export const rescueFormElsD: Array<_IFormEl> = [
  { label: '累计救援救灾次数', key: 'RESCUE_NUM', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
    
  },
  { label: '累计救援救灾出动人数', key: 'RESCUE_USER_NUM', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '重要救援行动总结报告例数', key: 'REPORT_NUM', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '队员年平均培训时长(小时)', key: 'CULTIVATE_TIME', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '可跨区域机动人数(人)', key: 'CROSSREGION_NUM', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '自我保障时间(小时)', key: 'SELFSECURITY_TIME', col: { span: 6,}, element: 'input', 
    formItemProps: { ...jyItemProps, required: true } , componentProps: { disabled:true }
  },
]

// 装备已查看详情页的基本信息 -- 表单
export const equipViewFormElsD: Array<_IFormEl> = [
  { label: '名称', key: 'EQUIPMENT_NAME', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '隶属', key: 'TEAM_SUBJECTION', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  // { label: '物资点能力', key: 'c', col: { span: 6,}, element: 'input', 
  //   formItemProps: { ...formItemProps, required: true } 
  // },
  { label: '地址', key: 'ADDRESS', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '经度', key: 'LONGITUDE', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '纬度', key: 'LATITUDE', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '主要负责人姓名', key: 'RESPONSIBLE_NAME', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
  { label: '联系电话', key: 'RESPONSIBLE_TEL', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true }, componentProps: { disabled:true } 
  },
  { label: '电子邮件', key: 'RESPONSIBLE_EMAIL', col: { span: 6,}, element: 'input', 
    formItemProps: { ...formItemProps, required: true } , componentProps: { disabled:true }
  },
]